/* 
 * 恋爱交友小程序全局基础样式
 * 此文件定义了应用的全局样式重置和通用样式
 * 在app.vue中引入: @import "./styles/base.scss";
 */

@import "./variables.scss";

/* 全局重置 */
page {
  font-size: $font-normal;
  color: $text-primary;
  background-color: $bg-color;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

view, text, navigator, button, input, textarea, image {
  box-sizing: border-box;
}

/* 移除按钮默认样式 */
button {
  padding: 0;
  margin: 0;
  background-color: transparent;
  border: none;
  border-radius: 0;
  outline: none;
  
  &::after {
    border: none;
  }
}

/* 移除导航默认样式 */
navigator {
  color: inherit;
}

/* 通用布局类 */
.container {
  min-height: 100vh;
  background-color: $bg-color;
  padding: $padding-large;
}

.card {
  background-color: $white;
  border-radius: $radius-large;
  padding: $padding-large;
  margin-bottom: $spacing-medium;
  box-shadow: $shadow-light;
}

/* 文本样式 */
.text-primary {
  color: $text-primary;
}

.text-secondary {
  color: $text-secondary;
}

.text-light {
  color: $text-light;
}

.text-brand {
  color: $primary-color;
}

.text-success {
  color: $success-color;
}

.text-warning {
  color: $warning-color;
}

.text-error {
  color: $error-color;
}

.text-link {
  color: $link-color;
}

/* 字体大小 */
.font-large {
  font-size: $font-large;
}

.font-title {
  font-size: $font-title;
}

.font-subtitle {
  font-size: $font-subtitle;
}

.font-normal {
  font-size: $font-normal;
}

.font-small {
  font-size: $font-small;
}

.font-mini {
  font-size: $font-mini;
}

/* 字重 */
.font-bold {
  font-weight: $font-weight-bold;
}

.font-normal-weight {
  font-weight: $font-weight-normal;
}

.font-light {
  font-weight: $font-weight-light;
}

/* 文本对齐 */
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* 文本溢出 */
.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ellipsis-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 弹性布局 */
.flex {
  display: flex;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-around {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.flex-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.align-center {
  align-items: center;
}

.align-start {
  align-items: flex-start;
}

.align-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

/* 间距 */
.mt-large {
  margin-top: $spacing-large;
}

.mt-medium {
  margin-top: $spacing-medium;
}

.mt-small {
  margin-top: $spacing-small;
}

.mb-large {
  margin-bottom: $spacing-large;
}

.mb-medium {
  margin-bottom: $spacing-medium;
}

.mb-small {
  margin-bottom: $spacing-small;
}

.ml-large {
  margin-left: $spacing-large;
}

.ml-medium {
  margin-left: $spacing-medium;
}

.ml-small {
  margin-left: $spacing-small;
}

.mr-large {
  margin-right: $spacing-large;
}

.mr-medium {
  margin-right: $spacing-medium;
}

.mr-small {
  margin-right: $spacing-small;
}

/* 按钮样式 */
.btn-primary {
  background-color: $primary-color;
  color: $white;
  border-radius: $button-radius;
  font-size: $font-subtitle;
  padding: $padding-medium $padding-large;
  text-align: center;
}

.btn-secondary {
  background-color: $white;
  color: $primary-color;
  border: 1px solid $primary-color;
  border-radius: $button-radius;
  font-size: $font-subtitle;
  padding: $padding-medium $padding-large;
  text-align: center;
}

.btn-text {
  color: $primary-color;
  font-size: $font-normal;
  background: transparent;
  text-align: center;
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 6rpx 16rpx;
  background: $primary-light;
  color: $primary-color;
  border-radius: $radius-small;
  font-size: $font-mini;
  margin-right: $spacing-small;
}

/* 分割线 */
.divider {
  height: 1px;
  background-color: $border-color;
  margin: $spacing-medium 0;
}

/* 头像 */
.avatar {
  width: $avatar-medium;
  height: $avatar-medium;
  border-radius: $radius-circle;
  object-fit: cover;
}

.avatar-large {
  width: $avatar-large;
  height: $avatar-large;
  border-radius: $radius-circle;
  object-fit: cover;
}

.avatar-small {
  width: $avatar-small;
  height: $avatar-small;
  border-radius: $radius-circle;
  object-fit: cover;
}

.avatar-mini {
  width: $avatar-mini;
  height: $avatar-mini;
  border-radius: $radius-circle;
  object-fit: cover;
}

/* 图标 */
.icon {
  width: $icon-normal;
  height: $icon-normal;
}

.icon-large {
  width: $icon-large;
  height: $icon-large;
}

.icon-small {
  width: $icon-small;
  height: $icon-small;
}

.icon-mini {
  width: $icon-mini;
  height: $icon-mini;
}

/* 阴影 */
.shadow-light {
  box-shadow: $shadow-light;
}

.shadow-medium {
  box-shadow: $shadow-medium;
}

.shadow-dark {
  box-shadow: $shadow-dark;
}

/* 过渡 */
.transition {
  transition: $transition-normal;
}

.transition-fast {
  transition: $transition-fast;
}

.transition-slow {
  transition: $transition-slow;
}

/* 列表项 */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: $padding-large 0;
  border-bottom: 1px solid $border-color;
  
  &:last-child {
    border-bottom: none;
  }
}

/* 输入框 */
.input {
  background: $bg-color;
  border-radius: $radius-medium;
  padding: $padding-medium;
  font-size: $font-normal;
  color: $text-primary;
  width: 100%;
  box-sizing: border-box;
} 